﻿namespace WLFramework
{
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Linq;
    using System.Text;

    public static class FrameworkConfiguration
    {
        private static bool _debugMode = false;
        public static bool DebugMode
        {
            get { return _debugMode; }
            set { _debugMode = value; }
        }

        internal static bool CanDebug { get { return DebugMode && Log.Logger.IsConfigurated; } }
        internal static void DebugInfo(string function, Exception ex)
        {
            Log.Logger.Debug(string.Format(CultureInfo.InvariantCulture, "错误来源: {0}", function), ex);
        }

        internal static void DebugInfo(string function, string message)
        {
            Log.Logger.DebugFormat("错误来源:{0}, 错误内容:{1}", function, message);
        }
    }
}
